package com.qhit.service.impl;

import com.qhit.mapper.OrderMapper;
import com.qhit.pojo.Order;
import com.qhit.pojo.Tourist;
import com.qhit.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;

    public List<Map> getList(HashMap hashMap) {
        return orderMapper.getList(hashMap);
    }

    public int getListCount(HashMap hashMap) {
        return orderMapper.getListCount(hashMap);
    }

    public int add(Order order) {
        return orderMapper.add(order);
    }

    public int edit(Order g) {
        return orderMapper.edit(g);
    }

    public int del(int id) {
        return orderMapper.del(id);
    }

    public Order getOrderById(int id) {
        return orderMapper.getOrderById(id);
    }

    public List<Tourist> getTouristListByOrderId(int id) {
        return orderMapper.getTouristListByOrderId(id);
    }

    public List<Tourist> getOutTouristData(int id) {
        return orderMapper.getOutTouristData(id);
    }

    public int addTourist(int order_id, String tourist_id) {
        return orderMapper.addTourist(order_id,tourist_id);
    }

    public int delTourist(int order_id, String tourist_id) {
        return orderMapper.delTourist(order_id,tourist_id);
    }
}
